White balance processing method and apparatus

ABSTRACT

The present application provides a white balance processing method and apparatus. The method comprises: recognizing a portrait region in an image; calculating a target white balance gain value according to the area occupied by the portrait region in the image; and performing white balance processing on the image according to the target white balance gain value. The present application resolves the problems of poor user experience due to inaccurate image color restoration caused by a small area proportion of a human face region in an image during white balance adjustment according to the white balance gain value determined according to the area occupied by the human face in the case of a long photography distance.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Chinese Patent Application No.201710557843.5, filed by Guangdong OPPO Mobile Telecommunications Corp.Ltd. on Jul. 10, 2017 and entitled “White Balance Processing Method andApparatus”, the contents of which are hereby incorporated by referencein its entirety.

TECHNICAL FIELD

The disclosure relates to the technical field of terminals, andparticularly to a white balance processing method and device.

BACKGROUND

Along with the progress of sciences and technologies and development ofimage processing technologies, photographing technologies for mobileterminals (for example, smart phones and personal digital assistants)have also changed rapidly, including image processing software forprocessing Automatic White Balance (AWB) as well as automatic whitebalance for a face, i.e., FACE AWB.

However, during practical use, when FACE AWB is applied to a rear camerafor portrait shooting, the color accuracy of the shot photo is still lowafter the photo is adjusted by the FACE AWB, which results in whitebalance regulation error and poor user experience.

SUMMARY

The disclosure is intended to solve one of the technical problems in arelated art at least to a certain extent.

To this end, the disclosure discloses a white balance processing method,which solves the problems of inaccurate image color reproduction andpoor user experience caused by the fact that an area proportion of aface region in an image is relatively low when the white balanceregulation is performed according to a white balance gain valuedetermined based on an area occupied by the face region in condition ofa relatively long shooting distance.

The disclosure also discloses a white balance processing device.

The disclosure also discloses a computer device.

The disclosure also discloses a computer-readable storage medium.

The disclosure also discloses a computer program product.

A first aspect of embodiments of the disclosure discloses, a whitebalance processing method, which may include the following operations.

A portrait region in an image is identified.

A target white balance gain value is calculated according to an areaoccupied by the portrait region in the image.

White balance processing is performed on the image according to thetarget white balance gain value.

In the white balance processing method of the embodiments of thedisclosure, the portrait region in the image is identified, the targetwhite balance gain value is calculated according to the area occupied bythe portrait region in the image, and white balance processing isperformed on the image according to the target white balance gain value.This solves the technical problems of inaccurate image colorreproduction and poor user experience caused by the fact that an areaproportion of a face region in an image is relatively low when the whitebalance regulation is performed according to a white balance gain valuedetermined based on an area occupied by the face region in condition ofa relatively long shooting distance.

A second aspect of the embodiments of the disclosure discloses a whitebalance processing device, which may include a recognition module, acalculation module and a white balance module.

The recognition module may be configured to identify a portrait regionin an image.

The calculation module may be configured to calculate a target whitebalance gain value according to an area occupied by the portrait regionin the image.

The white balance module may be configured to perform white balanceprocessing on the image according to the target white balance gainvalue.

In the white balance processing device of the embodiments of thedisclosure, the recognition module is configured to identify theportrait region in the image, the calculation module is configured tocalculate the target white balance gain value according to the areaoccupied by the portrait region in the image, and the white balancemodule is configured to perform white balance processing on the imageaccording to the target white balance gain value. This solves thetechnical problems of inaccurate image color reproduction and poor userexperience caused by the fact that an area proportion of a face regionin an image is relatively low when the white balance regulation isperformed according to a white balance gain value determined based on anarea occupied by the face region in condition of a relatively longshooting distance.

A third aspect of the embodiments of the disclosure discloses a computerdevice, which may include a memory, a processor and a computer programstored in the memory and capable of running in the processor. Theprocessor executes the program to implement the white balance processingmethod of the first aspect of the embodiments.

A fourth aspect of the embodiments of the disclosure discloses acomputer-readable storage medium, in which a computer program may bestored. The program is executed by a processor to implement the whitebalance processing method of the first aspect of the embodiments.

A fifth aspect of the embodiments of the disclosure discloses a computerprogram product. An instruction in the computer program product isexecuted by a processor to execute the white balance processing methodof the first aspect of the embodiments.

Additional aspects and advantages of the disclosure will be partiallypresented in the following descriptions and partially become apparentfrom the following descriptions or get understood by implementing thedisclosure.

BRIEF DESCRIPTION OF DRAWINGS

The abovementioned and/or additional aspects and advantages of thedisclosure will become apparent and easy to understand from thedescriptions made to the embodiments below in combination with thedrawings.

FIG. 1 is a schematic flowchart of a white balance processing methodaccording to an embodiment of the disclosure.

FIG. 2 is a schematic flowchart of another white balance processingmethod according to an embodiment of the disclosure.

FIG. 3 is a structure diagram of a white balance processing deviceaccording to an embodiment of the disclosure.

FIG. 4 is a structure diagram of another white balance processing deviceaccording to an embodiment of the disclosure.

FIG. 5 is a block diagram of an exemplary computer device suitable forimplementing implementation modes of the disclosure.

DETAILED DESCRIPTION

The embodiments of the disclosure will be described below in detail.

Examples of the embodiments are illustrated in the drawings and the sameor similar reference signs always represent the same or similarcomponents or components with the same or similar functions. Theembodiments described below with reference to the drawings are exemplaryand intended to explain the disclosure and should not be understood aslimits to the disclosure.

A white balance processing method and device of the embodiments of thedisclosure will be described below with reference to the drawings.

FIG. 1 is a schematic flowchart of a white balance processing methodaccording to an embodiment of the disclosure. The method of theembodiment may be executed by a terminal with a data processingfunction, for example, a smart phone, a pad and a personal computer. Asillustrated in FIG. 1, the method includes the following operations.

In 101, a portrait region in an image is identified.

The portrait region includes a face region and a body region. That is,an area of the face region is smaller than an area of the portraitregion.

Specifically, the image is obtained by shooting with a rear cameraand/or shooting with a focal length greater than a preset focal lengththreshold, and face recognition is performed on the image to obtain theface region. Face recognition may be implemented by use of a facerecognition algorithm in the related art. There are no specific limitsmade herein.

Each pixel in the image includes depth information, and depthinformation of the face region is determined according to the identifiedface region. Regions with depths similar to that of the face region isdetermined as candidate regions, and the region adjacent to the faceregion in the candidate regions is identified as the portrait region inthe image.

In 102, a target white balance gain value is calculated according to anarea occupied by the portrait region in the image.

Specifically, an area proportion of the portrait region in the image iscalculated according to the area occupied by the portrait region in theimage, and a first gain value and second gain value of each colorcomponent are calculated according to the area proportion to obtain thewhite balance gain value.

The first gain value is used to regulate a face in the image to a skincolor.

Specifically, it is determined whether the skin color of the face in theimage is a normal face skin color. When the skin color of the face inthe image is not a normal face skin color, the first gain value capableof regulating the skin color of the face to the normal skin color isgenerated.

As a possible implementation mode, color components of all the pixels ofthe face region are acquired, a color of each pixel is represented by acolor component (R, G, B), and the color vectors of each pixel may beaveraged to calculate a color vector corresponding to the skin color ofthe face. It is determined whether R, G and B values corresponding tothe skin color of the face are within the range of R, G and B valuescorresponding to the normal face skin color. When R, G and B valuescorresponding to the skin color of the face are not within the range ofR, G and B values corresponding to the normal face skin color, the R, Gand B values corresponding to the skin color of the face are adjustedthrough a gain value to be within the range of R, G and B valuescorresponding to the normal face skin color, and the gain value is thefirst gain value.

The range of R, G and B values corresponding to the normal face skincolor may be determined according to R, G and B values provided in acolor matrix CC. The R, G and B values in the color matrix CC may beobtained according to a CIE color space provided by the CommissionInternationale de L'Eclairage.

The second gain value is different from the first gain value. The secondgain value refers to a gain value determined according to the portraitregion to adjust white balance and is calculated according to each colorcomponent in the portrait region.

As a possible implementation mode, when a color change in the colors ofthe image is enough, an average value of the three components R, G and Bin the color vectors of all the pixels tends to be balanced (1:1:1), anda relatively accurate white balance gain value, i.e., the second gainvalue, may be obtained by a grayscale weighting algorithm.

Specifically, the portrait region is divided into a plurality ofsub-blocks, color vectors of all pixels in each sub-block are acquired,and each pixel is represented by a color vector (R, G, B). Then anaverage value and standard deviation of three channels R, G and B ineach sub-block are calculated, and the standard deviation of eachsub-block is weighted (the low-correlated sub-blocks are discarded andthe high-correlated sub-blocks are reserved) to reduce influence of alarge-area single color and make the image colorful. An average value ofthe three channels R, G and B weighted with the standard deviation isfurther calculated, and a gain coefficient of the three channels R, Gand B is calculated to obtain the second gain value.

In 103, white balance processing is performed on the image according tothe target white balance gain value.

Specifically, Red (R) value and Blue (B) value data of each regulatedpixel are calculated according to the calculated target white balancegain value, thereby achieving color correction.

It is to be noted that, since a human eye is most sensitive to lightwith a Green (G) light wavelength (480 nm-600 nm) in a frequencyspectrum and the number of green pixels acquired in a Bayer array isgreatest, a present camera usually fixes a gain value of a component Gand then regulates gain values of a component R and a component B toregulate the component R and the component B respectively.

Furthermore, before the operation in 102, the method further includesthe following operation. It is determined that the area occupied by theportrait region in the image is less than a preset area threshold.

This is because, when the portrait region is relatively small, the areaof the face region is smaller, and in such case, if weights of the firstgain value and the second gain value are regulated based on the areaoccupied by the face region in the image, a face skin color regulationdoes not have a significant effect. Responsive to determining that thearea occupied by the portrait region in the image is less than thepreset area threshold, it is necessary to adopt a calculation manner ofcalculating the target white balance gain value based on the areaoccupied the portrait region in the image instead.

It is to be understood that, when the area occupied by the portraitregion in the image is less than the preset area threshold, it isindicated that the image is acquired in a distant shooting manner and isapplied to an application scenario of the disclosure.

Specifically, there are multiple possible implementation modes forcalculating the area occupied by the target region in the image. As apossible implementation mode, the image is divided into multiplesub-blocks, and each sub-block has the same area. For example, a targetpicture is divided into m*n sub-blocks, a length of each sub-block is1/m of a length of the target picture, and a width of each sub-block is1/n of a width of the target picture. Therefore, an area of eachsub-block is 1/m*n, where m and n are positive integers, and preferably,m is 9 and n is 7.

Furthermore, the acquired m*n sub-blocks are searched for sub-blocks ina coordinate interval of the face region and sub-blocks including anedge of the coordinate interval of the face region to obtain all thesub-blocks in the face region. An area of each sub-block is known, sothat the area of the face region may be calculated.

All sub-blocks in the portrait region may be found by the same method.An area of each sub-block is known, so that the area occupied by theportrait region in the image may be calculated.

It is determined whether the area occupied by the portrait region in theimage is less than the preset area threshold. Responsive to determiningthat the area occupied by the portrait region in the image is less thanthe preset area threshold, it is necessary to adopt the calculationmanner of calculating the target white balance gain value based on thearea occupied by the portrait region in the image.

In a practical application scenario, there is another possiblecircumstance. The area of the portrait region in the acquired image isnot small, and when it is determined that the area occupied by theportrait region in the image is not less than the preset area threshold,namely the area of the portrait region is relatively large, the area ofthe face region is correspondingly large. Under the circumstance, theeffect of the face skin color regulation is more significant if theweights of the first gain value and the second gain value are adjustedbased on the area occupied by the face region in the image. Therefore,responsive to determining that the area occupied by the portrait regionin the image is not less than the preset area threshold, a calculationmanner of calculating the target white balance gain value based on thearea occupied by the face region in the image may also be adoptedinstead. In the white balance processing method of the embodiments ofthe disclosure, the portrait region in the image is identified, thetarget white balance gain value is calculated according to the areaoccupied by the portrait region in the image, and white balanceprocessing is performed on the image according to the target whitebalance gain value. This solves the technical problems of inaccurateimage color reproduction and poor user experience caused by the factthat in condition of a relatively long shooting distance, an areaproportion of a face region in an image is relatively low when the whitebalance regulation is performed according to a white balance gain valuedetermined based on an area occupied by the face region.

For describing the previous embodiment clearly, the embodiments of thedisclosure provide another possible white balance processing method.FIG. 2 is a flowchart of another white balance processing methodaccording to an embodiment of the disclosure. The weights of the firstgain value and the second gain value are determined according to thearea proportion of the portrait region in the image, and a final whitebalance gain value is obtained by performing weighted calculation basedon the weights. As illustrated in FIG. 2, the method includes thefollowing operations.

In 201, an image is obtained by shooting with a rear camera, and/or, theimage is obtained by shooting with a focal length greater than a presetfocal length threshold.

Specifically, when the rear camera is adopted to shoot a portrait, adistance between the portrait and the camera is relatively long and anarea proportion of a face in the image is relatively low, and/or, whenthe focal length greater than the preset focal length threshold isadopted to shoot the portrait, namely distant shooting is performed, thearea occupied by the face in the obtained image is also relativelysmall.

It is to be noted that the rear camera may be a depth (Red-Green-BlueDepth, RGBD) camera or a structured light camera, may also be a dualcamera or a Time of Flight (TOF) camera and will not be enumeratedherein. Through these cameras, depth information of the shot image maybe obtained.

In 202, face recognition is performed on the image to obtain a faceregion.

Specifically, the face in the image is identified through a facerecognition technology to obtain a coordinate interval of the faceregion. There are multiple implementation manners for a face recognitionalgorithm in the related art. For example, an Adaboost model algorithmmay be adopted for face recognition, and another algorithm capable ofrapidly identifying the face region may also be adopted to identify theface region. The corresponding implementation manner for facerecognition is not limited in the embodiments of the disclosure.

In 203, candidate regions with depths similar to that or the face regionare determined according to depth information of the image, and theregions adjacent to the face region in the candidate regions areidentified as a portrait region in the image.

The depth information indicates a distance between each pixel in theimage and the camera.

Specifically, depth information corresponding to each pixel in the imageis obtained. The depth information of the pixels corresponding to theface region may be determined according to the determined face region,and the pixels with depth information similar to that of the pixelscorresponding, to the face region are determined as candidate pixels.Regions formed by the candidate pixels are the candidate regions, andthe regions adjacent to the face region in the candidate regions areidentified as the portrait region in the image.

In 204, an area proportion of the portrait region in the image iscalculated according to an area occupied by the portrait region in theimage.

Specifically, a quotient obtained by dividing the area of the portraitregion by a total area of the image is the area proportion of theportrait region in the image.

In 205, a weight of a first gain value and a weight of a second gainvalue are determined according to the area proportion.

Specifically, for convenient description, the weight of the first gainvalue is set to be K, and meanwhile, and the weight of the second gainvalue is determined to be 1-K. A value of K is determined according tothe area proportion. In general, the area proportion is positivelycorrelated to the value of K.

In 206, weighted calculation is performed on the first gain value andthe second gain value according to the determined weight of the firstgain value and the weight of the second gain value to obtain a whitebalance gain value.

Specifically, the first gain value and the second gain value aremultiplied by the respective weights to calculate the white balance gainvalue, namely the white balance gain value=the first gain value*K+thesecond gain value*(1−K).

In 207, white balance processing is performed on the image according tothe target white balance gain value.

Specifically, an R value and B value in each color component in theimage are multiplied by the respective gain values in the white balancegain value according to the calculated white balance gain value toobtain R value and B value of the color component subjected to the whitebalance processing, so as to implement color adjustment of the image.

In the white balance processing method of the embodiments of thedisclosure, the portrait region in the image is identified, the targetwhite balance gain value is calculated according to the area occupied bythe portrait region in the image, and white balance processing isperformed on the image according to the target white balance gain value.This solves the technical problems of inaccurate image colorreproduction and poor user experience caused by the fact that incondition of a relatively long shooting distance, an area proportion ofa face region in an image is relatively low when the white balanceregulation is performed according to a white balance gain valuedetermined based on an area occupied by the face region.

For implementing the abovementioned embodiments, the disclosure alsodiscloses a white balance processing device.

FIG. 3 is a structure diagram of a white balance processing deviceaccording to an embodiment of the disclosure. As illustrated in FIG. 3,the device includes a recognition module 31, a calculation module 32 anda white balance module 33.

The recognition module 31 is configured to identify a portrait region inan image.

The calculation module 32 is configured to calculate a target whitebalance gain value according to an area occupied by the portrait regionin the image.

The white balance module 33 is configured to perform white balanceprocessing on the image according to the target white balance gainvalue.

As a possible implementation mode, the recognition module 31 isspecifically configured to perform face recognition on the image toobtain a face region, determine candidate regions with depths similar tothat of the face region according to depth information of the image andidentify regions adjacent to the face region in the candidate regions asthe portrait region in the image.

It is to be noted that explanations and descriptions about the methodembodiments are also applied to the device of the embodiment and willnot be elaborated herein.

In the white balance processing device of the embodiment, therecognition module is configured to identify the portrait region in theimage, the calculation module is configured to calculate the targetwhite balance gain value according to the area occupied by the portraitregion in the image, and the white balance module is configured toperform white balance processing on the image according to the targetwhite balance gain value. When a rear camera is adopted to shoot aportrait, the area of the portrait region in the image is relativelylarge, and thus the target white balance gain value of the image iscalculated according to the area occupied by the portrait region. Thissolves the technical problems of inaccurate imago color reproduction andpoor user experience caused by the fact that an area proportion of aface region in an image is relatively low when the white balanceregulation is performed according to a white balance gain valuedetermined based on an area occupied by the face region.

Based on the abovementioned embodiments, an embodiment of the disclosurealso provides a possible implementation mode of a white balanceprocessing device. FIG. 4 is a structure diagram of another whitebalance processing device according to an embodiment of the disclosure.Based on the previous embodiments, the device further includes ashooting module 34 and a determination module 35.

The shooting module 34 is configured to obtain the image by, shootingwith a rear camera, and/or, obtain the image by shooting with a focallength greater than a preset focal length threshold.

The determination module 35 is configured to determine that the areaoccupied by the portrait region in the image is less than a preset areathreshold.

As a possible implementation mode, the calculation module 32 may furtherinclude a first calculation unit 321 and a second calculation unit 322.

The first calculation unit 321 is configured to calculate an areaproportion of the portrait region in the image according to the areaoccupied by the portrait region in the image.

The second calculation unit 322 is configured to calculate a first gainvalue and a second gain value of each color component according to thearea proportion to obtain the white balance gain value. The first gainvalue is used to regulate a face in the image to a skin color and thesecond gain value is different from the first gain value.

As a possible implementation mode, the second calculation unit 322 mayfurther include a determination subunit 3221 and a second calculationsubunit 3222.

The determination subunit 3221 is configured to determine a weight ofthe first gain value and a weight of the second gain value according tothe area proportion.

The second calculation subunit 3222 is configured to perform weightedcalculation on the first gain value and the second gain value accordingto the determined weight of the first gain value and the weight of thesecond gain value to obtain the white balance gain value.

As a possible implementation mode, the device further includes adetermination and calculation module.

The determination and calculation module is configured to, when the areaoccupied by the portrait region in the image is not less than the presetarea threshold, calculate the target white balance gain value accordingto an area occupied by a face region in the image.

As a possible implementation mode, the device further includes anacquisition module.

The acquisition module is configured to perform synchronization imagingbetween a structured light camera or a depth camera and the camera forobtaining the image to obtain the depth information of the image.

It is to be noted that the explanations and descriptions about themethod embodiments are also applied to the device of the embodiments andwill not be elaborated herein.

In the white balance processing device of the embodiments, therecognition module is configured to identify the portrait region in theimage, the calculation module is configured to calculate the targetwhite balance gain value according to the area occupied by the portraitregion in the image, and the white balance module is configured toperform white balance processing on the image according to the targetwhite balance gain value. When the rear camera is adopted to shoot theportrait, the area of the portrait region in the image is relativelylarge, and the target white balance gain value of the image iscalculated according to the area occupied by the portrait region. Thissolves the technical problems of inaccurate image color reproduction andpoor user experience caused by the fact that an area proportion of aface region in an image is relatively low when the white balanceregulation is performed according to a white balance gain determinedbased on an area occupied by the face region. For implementing theabovementioned embodiments, the disclosure also discloses anotherdevice, which includes a processor and a memory configured to store aninstruction executable for the processor.

For implementing the abovementioned embodiments, the disclosure alsodiscloses a computer device, which includes a memory, a processor and acomputer program stored in the memory and capable of running in theprocessor. The processor executes the program to implement the whitebalance processing method of the method embodiments.

FIG. 5 is a block diagram of an exemplary computer device suitable forimplementing implementation modes of the disclosure. The computer device12 illustrated in FIG. 5 is only an example and should not form anylimit to functions and scope of application of the embodiments of thedisclosure.

As illustrated in FIG. 5, the computer device 12 is embodied in form ofa universal computer device. Components of the computer device 12 mayinclude, but not limited to: one or more processors or processing units16, a system memory 28 and a bus 18 connecting different systemcomponents (including the system memory 28 and the processing unit 16).

The bus 18 represents one or more of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, a processor or a local bus adopting any busstructure in multiple bus structures. For example, these systemstructures include, but not limited to, an Industry StandardArchitecture (ISA) bus, a Micro Channel Architecture (MAC) bus, anenhanced ISA bus, a Video Electronics Standards Association (VESA) localbus and a Peripheral Component Interconnection (PCI) bus.

The computer device 12 typically includes multiple computersystem-readable media. These media may be any available medium that thecomputer device 12 may access, including volatile and nonvolatile mediaand movable and immovable media.

The memory 28 may include a computer system-readable medium in form of anonvolatile memory, for example, a Random Access Memory (RAM) 30 and/ora high-speed cache memory 32. The computer device 12 may further includeanother movable/immovable and volatile/nonvolatile computer systemstorage medium. Only as an example, a storage system 34 may beconfigured to read and write an immovable and nonvolatile magneticmedium (not illustrated in FIG. 5 and usually called a “hard diskdrive”). Although not illustrated in FIG. 5, a magnetic disk driveconfigured to read and write a movable nonvolatile magnetic disk (forexample, a “floppy disk”) and an optical disk drive configured to readand write a movable nonvolatile optical disk (for example, a CompactDisc Read Only Memory (CD-ROM), a Digital Video Disc Read Only Memory(DVD-ROM) or another optical medium) may be provided. Under suchcircumstances, each drive may be connected with the bus 18 through oneor more data medium interfaces. The memory 28 may include at least oneprogram product. The program product includes a group of (for example,at least one) program modules, and these program modules are configuredto execute the functions of each embodiment of the disclosure.

A program/utility tool 40 with a group of (at least one) program modules42 may be stored in, for example, the memory 28. Such a program module42 includes, but not limited to, an operating system, one or moreapplication programs, another program module and program data, and eachor certain combination of these examples may include implementation of anetwork environment. The program module 42 usually executes thefunctions and/or method in the embodiments described in the disclosure.

The computer device 12 may also communicate with one or more externaldevices 14 (for example, a keyboard, a pointing device and a display24), and may further communicate with one or more devices through whicha user may interact with the computer device 12 and/or communicate withany device (for example, a network card and a modem) through which thecomputer device 12 may communicate with one or more other computerdevices. Such communication may be implemented through an Input/Output(I/O) interface 22. Moreover, the computer device 12 may furthercommunicate with one or more networks (for example, a Local Area Network(LAN) and a Wide Area Network (WAN) and/or public network, for example,the Internet) through a network adapter 20. As illustrated in FIG. 5,the network adapter 20 communicates with the other modules of thecomputer device 12 through the bus 18. It is to be understood that,although not illustrated in the figure, other hardware and/or softwaremodules may be used in combination with the computer device 12,including, but not limited to, a microcode, a device driver, a redundantprocessing unit, an external disk drive array, a Redundant Array ofIndependent Disks (RAID) system, a magnetic tape drive, a data backupstorage system and the like.

The processing unit 16 runs the program stored in the system memory 28,to execute various function applications and data processing, forexample, implementing the white balance processing method mentioned inthe abovementioned embodiments.

For implementing the abovementioned embodiments, the disclosure alsodiscloses a computer-readable storage medium, in which a computerprogram is stored. The program is executed by a processor to implementthe white balance processing method in the abovementioned methodembodiments.

For implementing the abovementioned embodiments, the disclosure alsodiscloses a computer program product. An instruction in the computerprogram product is executed by a processor to implement the whitebalance processing method in the abovementioned method embodiments.

In the descriptions of the specification, the descriptions made withreference to terms “an embodiment”, “some embodiments”, “example”,“specific example”, “some examples” or the like refer to that specificfeatures, structures, materials or characteristics described incombination with the embodiment or the example are included in at leastone embodiment or example of the disclosure. In the specification, theseterms are not always schematically expressed for the same embodiment orexample. The specific described features, structures, materials orcharacteristics may be combined in a proper manner in any one or moreembodiments or examples. In addition, those skilled in the art mayintegrate and combine different embodiments or examples described in thespecification and features of different embodiments or examples withoutconflicts.

In addition, terms “first” and “second” are only adopted for descriptionand should not be understood to indicate or imply relative importance orimplicitly indicate the number of indicated technical features.Therefore, a feature defined by “first” and “second” may explicitly orimplicitly indicate inclusion of at least one such feature. In thedescriptions of the disclosure, “multiple” means at least two, forexample, two and three, unless otherwise limited definitely andspecifically.

Any process or method in the flowcharts or described herein in anothermanner may be understood to represent a module, segment or partincluding codes of one or more executable instructions configured torealize specific logic functions or operations of the process and,moreover, the scope of the preferred implementation mode of thedisclosure includes other implementation, not in a sequence illustratedor discussed herein, including execution of the functions basicallysimultaneously or in an opposite sequence according to the involvedfunctions. This should be understood by those skilled in the art of theembodiments of the disclosure.

Logics and/or operations represented in the flowcharts or describedherein in another manner, for example, may be considered as a fixedsequence list of executable instructions configured to realize the logicfunctions and may specifically implemented in any computer-readablemedium for an instruction execution system, device or equipment (forexample, a computer-based system, a system including a processor oranother system capable of reading instructions from the instructionexecution system, device or equipment and executing the instructions) touse or for use in combination with the instruction execution system,device or equipment. For the specification, “computer-readable medium”may be any device capable of including, storing, communicating with,propagating or transmitting a program for the instruction executionsystem, device or equipment to use or for use in combination with theinstruction execution system, device or equipment. A more specificexample (non-exhaustive list) of the computer-readable medium includes:an electric connection portion (electronic device) with one or morewires, a portable computer disk (magnetic device), a RAM, a Read-OnlyMemory (ROM), an Erasable Programmable ROM (EPROM) (or flash memory), anoptical fiber device and a portable CD-ROM. In addition, thecomputer-readable medium may even be paper or another medium on whichthe program may be printed because, for example, the paper or the othermedium may be optically scanned then edited, explained or, whennecessary, processed in another proper manner to obtain the program inan electronic manner for storage in the computer memory.

It is to be understood that each part of the disclosure may beimplemented by hardware, software, firmware or a combination thereof. Inthe abovementioned implementation modes, multiple operations or methodsmay be implemented by software or firmware stored in a memory andexecuted by a proper instruction execution system. For example, in caseof implementation with the hardware, like another implementation mode,any one or combination of the following technologies well-known in theart may be adopted for implementation: a discrete logic circuit with alogic gate circuit configured to realize a logic function for a datasignal, an application-specific integrated circuit with a propercombined logic gate circuit, a Programmable Gate Array (PGA), a FieldProgrammable Gate Array (FPGA) and the like.

Those of ordinary skill in the art should understand that all or part ofthe operations in the method of the abovementioned embodiment may becompleted through related hardware instructed by a program. The programmay be stored in a computer-readable storage medium, and when theprogram is executed, one or combination of the operations of the methodembodiments is included.

In addition, each functional unit in each embodiment of the disclosuremay be integrated into a processing module, each unit may alsophysically exist independently, and two or more than two units may alsobe integrated into a module. The integrated module may be implemented ina hardware form and may also be implemented in form of softwarefunctional module. When being implemented in form of software functionalmodule and sold or used as an independent product, the integrated modulemay be stored in a computer-readable storage medium.

The storage medium may be a ROM, a magnetic disk, an optical disk or thelike. The embodiments of the disclosure have been illustrated ordescribed above. It can be understood that the abovementionedembodiments are exemplary and should not be understood as limits to thedisclosure and those of ordinary skill in the art may make variations,modifications, replacements, transformations to the abovementionedembodiments within the scope of the disclosure.

1. A white balance processing method, comprising: performing facerecognition on an image to obtain a face region; determining candidateregions with depths similar to that of the face region according todepth information of the image, and identifying a region adjacent to theface region in the candidate regions as a portrait region in the image,the portrait region comprising the face region and a body region;determining that an area occupied by the portrait region in the image isless than a preset area threshold; calculating, when the area occupiedby the portrait region in the image is not less than the preset areathreshold, a target white balance gain value according to an areaoccupied by the face region in the image; calculating, when the areaoccupied by the portrait region in the image is less than the presetarea threshold, a target white balance gain value according to the areaoccupied by the portrait region in the image; and performing whitebalance processing on the image according to the target white balancegain value.
 2. The white balance processing method of claim 1, whereincalculating the target white balance gain value according to the areaoccupied by the portrait region in the image comprises: calculating anarea proportion of the portrait region in the image according to thearea occupied by the portrait region in the image; and calculating afirst gain value and a second gain value of each color componentaccording to the area proportion to obtain the target white balance gainvalue, the first gain value being used to regulate a face in the imageto a skin color and the second gain value being different from the firstgain value.
 3. The white balance processing method of claim 2, whereincalculating the first gain value and the second gain value of each colorcomponent according to the area proportion to obtain the target whitebalance gain value comprises: determining a weight of the first gainvalue and a weight of the second gain value according to the areaproportion; and performing weighted calculation on the first gain valueand the second gain value according to the determined weight of thefirst gain value and the weight of the second gain value to obtain thetarget white balance gain value.
 4. The white balance processing methodof claim 1, wherein before identifying the portrait region in the image,the method further comprises at least one of the following: obtainingthe image by shooting with a rear camera; or, obtaining the image byshooting with a focal length greater than a preset focal lengththreshold. 5.-8. (canceled)
 9. A white balance processing device,comprising: a recognition module, configured to perform face recognitionon an image to obtain a face region, determine candidate regions withdepths similar to that of the face region according to depth informationof the image, and identify a region adjacent to the face region in thecandidate regions as a portrait region in the image, the portrait regioncomprising the face region and a body region; a calculation module,configured to calculate, when it is determined that the area occupied bythe portrait region in the image is not less than the preset areathreshold, a target white balance gain value according to an areaoccupied by the face region in the image, and further configured tocalculate, when it is determined that the area occupied by the portraitregion in the image is less than the preset area threshold, a targetwhite balance gain value according to the area occupied by the portraitregion in the image; and a white balance module, configured to performwhite balance processing on the image according to the target whitebalance gain value.
 10. The white balance processing device of claim 9,wherein the calculation module comprises: a first calculation unit,configured to calculate an area proportion of the portrait region in theimage according to the area occupied by the portrait region in theimage; and a second calculation unit, configured to calculate a firstgain value and a second gain value of each color component according tothe area proportion to obtain the white balance gain value, the firstgain value being used to regulate a face in the image to a skin colorand the second gain value being different from the first gain value.11.-16. (canceled)
 17. A computer device, comprising a memory, aprocessor and a computer program stored in the memory and capable ofrunning in the processor, wherein the processor executes the program toimplement a white balance processing method, the method comprising:performing face recognition on an image to obtain a face region;determining candidate regions with depths similar to that of the faceregion according to depth information of the image, and identifying aregion adjacent to the face region in the candidate regions as aportrait region in the image, the portrait region comprising the faceregion and a body region; determining that an area occupied by theportrait region in the image is less than a preset area threshold;calculating, when the area occupied by the portrait region in the imageis not less than the preset area threshold, a target white balance gainvalue according to an area occupied by the face region in the image;calculating, when the area occupied by the portrait region in the imageis less than the preset area threshold, a target white balance gainvalue according to the area occupied by the portrait region in theimage; and performing white balance processing on the image according tothe target white balance gain value.
 18. A computer-readable storagemedium, having a computer program stored thereon, wherein the program isexecuted by a processor to implement a white balance processing method,the method comprising: performing face recognition on an image to obtaina face region; determining candidate regions with depths similar to thatof the face region according to depth information of the image, andidentifying a region adjacent to the face region in the candidateregions as a portrait region in the image, the portrait regioncomprising the face region and a body region; determining that an areaoccupied by the portrait region in the image is less than a preset areathreshold; calculating, when the area occupied by the portrait region inthe image is not less than the preset area threshold, a target whitebalance gain value according to an area occupied by the face region inthe image; calculating, when the area occupied by the portrait region inthe image is less than the preset area threshold, a target white balancegain value according to the area occupied by the portrait region in theimage; and performing white balance processing on the image according tothe target white balance gain value.
 19. (canceled)
 20. The whitebalance processing method of claim 2, wherein before identifying theportrait region in the image, the method further comprises at least oneof the following: obtaining the image by shooting with a rear camera;or, obtaining the image by shooting with a focal length greater than apreset focal length threshold.
 21. The white balance processing methodof claim 3, wherein before identifying the portrait region in the image,the method further comprises at least one of the following: obtainingthe image by shooting with a rear camera; or, obtaining the image byshooting with a focal length greater than a preset focal lengththreshold.
 22. The computer device of claim 17, wherein the processorexecutes the program to implement the following operations: calculatingan area proportion of the portrait region in the image according to thearea occupied by the portrait region in the image; and calculating afirst gain value and a second gain value of each color componentaccording to the area proportion to obtain the target white balance gainvalue, the first gain value being used to regulate a face in the imageto a skin color and the second gain value being different from the firstgain value.
 23. The computer device of claim 22, wherein the processorexecutes the program to implement the following operations: determininga weight of the first gain value and a weight of the second gain valueaccording to the area proportion; and performing weighted calculation onthe first gain value and the second gain value according to thedetermined weight of the first gain value and the weight of the secondgain value to obtain the target white balance gain value.
 24. Thecomputer device of claim 17, wherein the processor executes the programto implement at least one of the following operations: obtaining theimage by shooting with a rear camera; or, obtaining the image byshooting with a focal length greater than a preset focal lengththreshold.
 25. The computer device of claim 22, wherein the processorexecutes the program to implement at least one of the followingoperations: obtaining the image by shooting with a rear camera; or,obtaining the image by shooting with a focal length greater than apreset focal length threshold.
 26. The computer device of claim 23,wherein the processor executes the program to implement at least one ofthe following operations: obtaining the image by shooting with a rearcamera; or, obtaining the image by shooting with a focal length greaterthan a preset focal length threshold.
 27. The computer-readable storagemedium of claim 18, wherein the program is executed by a processor toimplement the following operations: calculating an area proportion ofthe portrait region in the image according to the area occupied by theportrait region in the image; and calculating a first gain value and asecond gain value of each color component according to the areaproportion to obtain the target white balance gain value, the first gainvalue being used to regulate a face in the image to a skin color and thesecond gain value being different from the first gain value.
 28. Thecomputer-readable storage medium of claim 27, wherein the program isexecuted by a processor to implement the following operations:determining a weight of the first gain value and a weight of the secondgain value according to the area proportion; and performing weightedcalculation on the first gain value and the second gain value accordingto the determined weight of the first gain value and the weight of thesecond gain value to obtain the target white balance gain value.
 29. Thecomputer-readable storage medium of claim 18, wherein the program isexecuted by a processor to implement at least one of the followingoperations: obtaining the image by shooting with a rear camera; or,obtaining the image by shooting with a focal length greater than apreset focal length threshold.
 30. The computer-readable storage mediumof claim 27, wherein the program is executed by a processor to implementat least one of the following operations: obtaining the image byshooting with a rear camera; or, obtaining the image by shooting with afocal length greater than a preset focal length threshold.
 31. Thecomputer-readable storage medium of claim 28, wherein the program isexecuted by a processor to implement at least one of the followingoperations: obtaining the image by shooting with a rear camera; or,obtaining the image by shooting with a focal length greater than apreset focal length threshold.